<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件
error_reporting(E_ERROR | E_WARNING | E_PARSE);
/**
 * $msg 待提示的消息
 * $url 待跳转的链接
 * $icon 这里主要有两个，5和6，代表两种表情（哭和笑）
 * $time 弹出维持时间（单位秒）
 */
function jumpinfo($message, $url, $jptime = 1,$icon = 6) {
    $str="<style>#layui-layer1{ width: 240px !important;}</style>";
    $str.= "<script src=\"" .  config('WEB_URL') . "static/admin/js/jquery-3.1.1.min.js\" type=\"text/javascript\"></script>";
    $str.=  "<script src=\"" . config('WEB_URL') . "static/layer1/layer1.js\" type=\"text/javascript\"></script>";
    $str.=  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\" />";
    $str.= "<script>$(function(){layer1.msg('" . $message . "',{icon:$icon,time:'" . ($jptime * 1000) . "'}, function (){location.href= '" . $url . "';})})</script>";
    return $str;
}